# Converts A UVES_popler .dat output file into a file with wavelgnth,
# flux, error, continuum
import sys
from astro.io import readcol,writecol

filenames = sys.argv[1:]

for filename in filenames:
	wav,normfl,normer,foo,cont = readcol(filename)
	writecol(filename[:-5] + 'c.dat',[wav,normfl*cont,normer*cont,cont])
